import java.util.Comparator;

//写一个泛型类，求一个数组中的最大值
class Maxx<T extends Comparable<T>> {
    public T findMax(T[] array) {
        T max = array[0];
        for (int i = 1; i < array.length; i++) {
            if(array[i].compareTo(max)>0)
                max = array[i];
        }
        return max;
    }
}
public class Max {
    public static void main(String[] args) {
        Integer[] array = {1,2,3,4,5,6,7,8};
        Maxx<Integer> m = new Maxx<>();
        System.out.println(m.findMax(array));
    }
}
